package com.realtyManage.springboot.Service.impl;

import com.realtyManage.springboot.Dao.SmsRepository;
import com.realtyManage.springboot.Model.Do.Sms;
import com.realtyManage.springboot.Service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * IndexServiceImpl
 *
 * @Author 杭州素色网络科技有限公司
 * @Date 2019/3/22
 **/
@Service
@Transactional
public class SmsServiceImpl implements ISmsService{
    @Autowired
    private SmsRepository smsRepository;


    @Override
    public void insert(Sms sms) {
        smsRepository.saveAndFlush(sms);
    }

    @Override
    public Sms findByPhone(String userPhone) {
        return smsRepository.findByPhone(userPhone);
    }

    @Override
    public void delSms(String phone) {
        smsRepository.deleteByPhone(phone);
    }
}
